package com.hjh.net

import okhttp3.Interceptor
import okhttp3.Response


/**
 * @author hjh
 * @version 1.0
 * @since 1.0
 * @date 2024/3/19
 * @qq 3472903821
 * @description 请求头拦截
 */
class HeaderInterceptor : Interceptor {
    override fun intercept(chain: Interceptor.Chain): Response {
        return chain.proceed(chain.request())
        // val originalRequest = chain.request()
        // val request = originalRequest.newBuilder().apply {
        //     if (originalRequest.url.toString()
        //             .contains(FileApi().iotFileUrl)
        //     ) {
        //         header("X-HW-ID", FileApi.X_HW_ID)
        //         header("X-HW-APPKEY", ServerSettingParamHelper().iotCenterKey)
        //     }
        //     if (originalRequest.url.toString().contains(FileApi().upload)
        //     ) {
        //         header("Content-Type", FileApi.CONTENT_TYPE)
        //     }
        // }.build()
        // return chain.proceed(request)
    }
}